package com.fh.alipay.mapper;

import com.fh.alipay.po.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import com.fh.alipay.model.query.UserQuery;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * @author fh
 * @date 2022-05-03
 * @description  小程序管理用户 Mapper 接口
 */
@Repository
public interface UserMapper extends BaseMapper<User> {

    IPage<User> getWithPage(Page page, @Param("query") UserQuery query);

    /**
     * 新增后返回id
     * @param po
     * @return
    */
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    Long insertReturnId(@Param("po") User po);

    int getCountByQuery(@Param("query") UserQuery query);

    User getOneByQuery(@Param("query") UserQuery query);

    List<User> getAllByQuery(@Param("query") UserQuery query);

}
